import org.junit.Test;

import java.util.Arrays;
import java.util.List;

public class Mine {
    @Test
    public void test01() {
        List<String> al = Arrays.asList("1.txt", "2.txt", "3.pdf");
        System.out.println(al.stream().filter(str -> str.endsWith(".txt")).count());
    }
}
